import {LOADLOANDATA, SUBMITEDITLOAN} from '../../types'
import {fetch} from '../../../utils/http'
const state = {
  data: {
    applydata: {}
  }
}

const mutations = {
  [LOADLOANDATA] (state, payload) {
    let utl = '/article/test/getApplyById?id=' + payload
    fetch(utl, {
    }).then((response) => {
      state.data.applydata = response.info
    }).catch((error) => {
      console.log(error.response)
    })
  },
  [SUBMITEDITLOAN] (state, payload) {
    console.log(payload)
    console.log(state.data.applydata.deaDealerName)
  }
}

const actions = {
  [LOADLOANDATA] ({commit}, payload) {
    commit('loadLoanData', payload)
  },
  [SUBMITEDITLOAN] ({commit}, payload) {
    commit('submitEditLoan', payload)
  }
}

export default {
  state,
  mutations,
  actions
}
